<?php
$this->breadcrumbs=array(
    'Looking For People' => "index.php?lang={$lang}&r=Jobseeker/List",
    'Staff Detail'
);
$edu = $staffDetail['PageLanguage'] == 'en' ? JobSeeker::getEducationEN($staffDetail['Education']) : JobSeeker::getEducationTH($staffDetail['Education']);
$Edu = $staffDetail['Institution'] . ' - ' . $edu . ' ' . $staffDetail['Major'];
$LangSkill = '';
if ($staffDetail['EnSkill'] >= 3) {
    $LangSkill .= "English: ";
    $LangSkill .= $staffDetail['PageLanguage'] == 'en' ? JobSeeker::getLanguageSkillEN($staffDetail['EnSkill']) : JobSeeker::getLanguageSkillTH($staffDetail['EnSkill']);
}
if ($staffDetail['JpSkill'] >= 3) {
    $LangSkill .= $LangSkill != '' ? '<br>' : '';
    $LangSkill .= "Japanese: ";
    $LangSkill .= $staffDetail['PageLanguage'] == 'en' ? JobSeeker::getLanguageSkillEN($staffDetail['JpSkill']) : JobSeeker::getLanguageSkillTH($staffDetail['JpSkill']);
}
?>
<h1>Staff Detail</h1>
<div class="alert alert-<?= $staffDetail['Gender'] == 'M'?'info':'error' ?>">
    <img src="images/001_<?= $staffDetail['Gender'] ?>.png">
    <b><span><?= $staffDetail['Gender'] == 'M' ? 'Male' : 'Female' ?> (<?= GM::findYear($staffDetail['DOB'], date("Y-m-d")) ?> years old) : <?= $staffDetail['Nationality'] ?></span>
        <span class="pull-right">Staff ID : <?= $staffDetail['StaffID'] ?></span></b>
</div>
<table class="table table-bordered">
    <tbody>
        <tr><td class="rowheader">Education :</td><td><?= $Edu ?></td></tr>
        <tr><td class="rowheader">Language :</td><td><?= $LangSkill ?></td></tr>
        <tr><td class="rowheader">Work position:</td><td><?= $staffDetail['WorkPosition'] ?></td></tr>
        <tr><td class="rowheader">Work experience detail:</td><td><?= $staffDetail['WorkExperienceDetail'] ?></td></tr>
        <tr><td class="rowheader">Desired Job Position:</td><td><?= $staffDetail['ExpectWorkingPosition'] ?></td></tr>
        <tr><td class="rowheader">Hope Salary:</td><td><?= $staffDetail['ExpectSalary'] ?></td></tr>
        <tr><td class="rowheader">Work location:</td><td><?= $staffDetail['ExpectLocationName'] ?></td></tr>
        <tr><td class="rowheader">Note:</td><td><?= $staffDetail['Note'] ?></td></tr>
    </tbody>
</table>
<script>
    $(function(){
        //fill '-' cell(td)empty
        $('td').each(function(){
            if($(this).text()==''){
                $(this).text('-');
            }
        });
    });
</script>